"use strict";

const Service = require('egg').Service;

class StuService extends Service {
  async addStu(params) {
    try {
      const result = await this.app.mysql.insert('stu', params);
      return result;
    } catch (error) {
      return error;
    }
  }
  async getStu() {
   try {
    const result = await this.app.mysql.select('stu');
    return result;
   } catch (error) {
    return error;
   }
  } 
  async updateStu(params) {
    try {
      const result = await this.app.mysql.update('stu', params);
      return result;
    } catch (error) {
      return error;
    }
  }
  async delStu(params) {
    try {
      const result = await this.app.mysql.delete('stu', params);
      return result;
    } catch (error) {
      return error;
    }
  }
} 

module.exports = StuService;